import tkinter
import tkinter.messagebox as tkMessageBox

top = tkinter.Tk()
# 进入消息循环


def helloCallBack():
    tkMessageBox.showinfo("Hello Python", "Hello Runoob")

B = tkinter.Button(top, text="点我", command=helloCallBack)

B.pack()
top.mainloop()